<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JQuery练习</title>
</head>
<body>
<button id="id1">按id查找元素</button>
<button class="cc1 cc2 cc3 cc4">按class查找元素</button>
<span>按名字查找元素</span>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
    $(function() {
        $("#id1").click(function(){
            alert("你点击了“按id查找元素”");
        });

        $(".cc1").click(function(){
            alert("你点击了“按class查找元素”");
        });

        $("span").click(function(){
            alert("你点击了“按名字查找元素”");
        });
    });
</script>
</body>
</html>